package com.yzkj.cpjxc.business.framework.common;

import java.util.*;

/**
 * 常量类
 */
public class Constants {

	/**
	 * web相对路径, SysInitListener启动的时候会给其加上应用名:JEE_Framework_WEB_RELATIVE_PATH_UUID(随机种子)
	 */
	public static String WEB_RELATIVE_PATH = "WEB_RELATIVE_PATH";

	/**
	 * 是否是开发模式, SysInitListener启动的时候会给其加上应用名:JEE_Framework_isDevelop
	 */
	public static String IS_DEVELOP = "isDevelop";

	/**
	 * 保存失败提示
	 */
	public static String SAVE_ERROR = "保存失败";

	/**
	 * 操作部门树提示
	 */
	public static String DEPT_TREE_ERROR = "你没有足够的权限操作该部门，你必须属于该部门或者它的父部门";

	/**
	 * 操作角色树提示
	 */
	public static String ROLE_TREE_ERROR = "你没有足够的权限操作该角色，你必须属于该角色或者它的父角色";

	/**
	 * 主要用于返回页面时定义的
	 */
	public final static String MESSAGE = "mess";

	/**
	 * 是否通过安全检查
	 */
	public final static String IS_THROUGH_SECURITY_CHECK = "isThroughSecurityCheck";

	/**
	 * 真，字符类型
	 */
	public final static String IS_TRUE = "true";

	/**
	 * 假，字符类型
	 */
	public final static String IS_FALSE = "false";

	/**
	 * 真，布尔类型
	 */
	public final static boolean TRUE = true;

	/**
	 * 假，布尔类型
	 */
	public final static boolean FALSE = false;

	/**
	 * 错误信息
	 */
	public final static String ERROR_MSG = "errorMsg";

	/**
	 * 警告信息
	 */
	public final static String WARNING_MSG = "warningMsg";

	/**
	 * 登录用户
	 */
	public final static String CURRENT_USER = "currentUser";
	
	/**
	 * 当前账套
	 */
	public final static String CURRENT_ZHANG_TAO = "currentZhangTao";
	
	/**
	 * 当前账套未结账信息
	 */
	public final static String CURRENT_JIE_ZHANG = "currentJieZhang";

	/**
	 * 超级管理员
	 */
	public final static String ADMIN = "admin";

	/**
	 * 超级管理员账号
	 */
	public final static String ADMIN_NAME = "超级管理员";

	/**
	 * 顶级部门中文名称
	 */
	public final static String DJ_DEPT_CN_NAME = "海南省委员会";

	/**
	 * 顶级部门英文名称
	 */
	public final static String DJ_DEPT_EN_NAME = "HNSWYH";

	/**
	 * 顶级部门简称
	 */
	public final static String DJ_DEPT_REFERREDE = "HNSWYH";

	/**
	 * 默认初始密码
	 */
	public final static String DEFAULT_PASS = "123456";

	/**
	 * 成功
	 */
	public final static String SUCCESS = "succ";

	/**
	 * 失败
	 */
	public final static String ERROR = "err";

	///////////////////////////删除状态/////////////////////////////////////////////////////

	/**
	 * 已删除
	 */
	public final static String DELETE_FLAG_YES = "1";

	/**
	 * 未删除
	 */
	public final static String DELETE_FLAG_NO = "-1";

	/**
	 * 删除标记Map
	 */
	public static Map<String, String> getDeleteFlagMap() {
		HashMap<String, String> map = new LinkedHashMap<String, String>();
		map.put(DELETE_FLAG_YES, "已删除");
		map.put(DELETE_FLAG_NO, "未删除");
		return map;
	}

	///////////////////////////启用状态/////////////////////////////////////////////////////
	/**
	 * 启用
	 */
	public final static String STATUS_ACTIVE = "1";

	/**
	 * 停止
	 */
	public final static String STATUS_INACTIVE = "-1";

	/**
	 * 状态Map
	 */
	public static Map<String, String> getStutasMap() {
		HashMap<String, String> map = new LinkedHashMap<String, String>();
		map.put(STATUS_ACTIVE, "启用");
		map.put(STATUS_INACTIVE, "停止");
		return map;
	}

	/**
	 * 防范CSRF攻击，建立Token
	 */
	public final static String CSRF_TOKEN_PARAM_NAME = "CSRFToken";

	/**
	 * 建立Token与Session的常量
	 */
	public final static String CSRF_TOKEN_FOR_SESSION_ATTR_NAME = CSRFTokenManager.class.getName() + ".tokenval";

	/**
	 * 状态:警告
	 */
	public static final String STATUS_WARN = "1";

	/**
	 * 状态:正常
	 */
	public static final String STATUS_NORMAL = "0";

	/**
	 * 状态:系统异常
	 */
	public static final String STATUS_EXCEPTION = "-1";

	/**
	 *  状态：无访问权限
	 */
	public static final String STATUS_NO_ACCESS = "-2";

	/**
	 * 状态：cxf漏洞捕获SecurityInterceptor
	 */
	public static final String STATUS_SECURITY_NOT_PASS = "-3";

	/**
	 * 返回json状态  失败
	 */
	public final static String JSON_RESULT_FAILURE = "0";

	/**
	 * 返回json状态  成功
	 */
	public final static String JSON_RESULT_SUCCESS = "1";

	/**
	 * 无效
	 */
	public final static String NOT_ACTIVE = "0";

	/**
	 * 有效
	 */
	public final static String ACTIVE = "1";

	/**
	 * 假删
	 */
	public final static String DEL_ACTIVE = "2";
	
	public final static String IS_YJZ = "1";//已结账
	public final static String IS_WJZ = "0";//未结账

	
	/**
	 * 当前登录用户批量导入进行中session标识
	 */
	public final static String EXECUTE_BULK_IMPORT = "EXECUTE_BULK_IMPORT";

	/**
	 * 发布状态：发布
	 */
	public static final String INFOSTATE_YES = "1";

	/**
	 * 发布状态：停用
	 */
	public static final String INFOSTATE_NO = "2";

	/**
	 * 文件类型：文本图片
	 */
	public static final String INFODATATYPE_TEXT = "1";

	/**
	 * 文件类型：文件下载
	 */
	public static final String INFODATATYPE_FILE = "2";

	//科目分类
	public static final String KMFL_ZC = "ZC";
	public static final String KMFL_FZ = "FZ";
	public static final String KMFL_QY = "QY";
	public static final String KMFL_CB = "CB";
	public static final String KMFL_SY = "SY";
	public static LinkedHashMap<String, String> GET_KMFL_MAP = new LinkedHashMap<String, String>();
	static {
		GET_KMFL_MAP.put(KMFL_ZC, "资产");
		GET_KMFL_MAP.put(KMFL_FZ, "负债");
		GET_KMFL_MAP.put(KMFL_QY, "权益");
		GET_KMFL_MAP.put(KMFL_CB, "成本");
		GET_KMFL_MAP.put(KMFL_SY, "损益");
	}
	
	//报表分类
	public static final String REPORT_ZCFZB = "report_zcfzb";//资产负载表
	public static final String REPORT_LRB = "report_lrb";//利润表
	public static final String REPORT_XJLLB = "report_xjllb";//现金流量表
	public static LinkedHashMap<String, String> REPORT_TYPE_MAP = new LinkedHashMap<String, String>();
	static {
		REPORT_TYPE_MAP.put(REPORT_ZCFZB, "资产负载表");
		REPORT_TYPE_MAP.put(REPORT_LRB, "利润表");
		REPORT_TYPE_MAP.put(REPORT_XJLLB, "现金流量表");
	}
	
	//信息类别
	public static LinkedHashMap<String, String> GET_INFOCONTENTTYPE_MAP = new LinkedHashMap<String, String>();
	static {
		GET_INFOCONTENTTYPE_MAP.put("1", "系统公告通知");
		GET_INFOCONTENTTYPE_MAP.put("2", "报表上报通知");
		GET_INFOCONTENTTYPE_MAP.put("3", "其他公告通知");
	}

	//文件类型
	public static LinkedHashMap<String, String> GET_INFODATATYPE_MAP = new LinkedHashMap<String, String>();
	static {
		GET_INFODATATYPE_MAP.put(Constants.INFODATATYPE_TEXT, "文本");
		GET_INFODATATYPE_MAP.put(Constants.INFODATATYPE_FILE, "文件");
	}

	//发布状态
	public static LinkedHashMap<String, String> GET_INFOSTATE_MAP = new LinkedHashMap<String, String>();
	static {
		GET_INFOSTATE_MAP.put(Constants.INFOSTATE_YES, "发布 ");
		GET_INFOSTATE_MAP.put(Constants.INFOSTATE_NO, "停用");
	}

	//推送状态
	public static LinkedHashMap<String, String> GET_ISPUSH_MAP = new LinkedHashMap<String, String>();
	static {
		GET_ISPUSH_MAP.put("1", "已推送");
		GET_ISPUSH_MAP.put("2", "未推送");
	}

	public static final String DATAVALLEY = "DataValley";

	public static LinkedHashMap<String, String> isPassEvaluatingMap = new LinkedHashMap<String, String>();
	static {
		isPassEvaluatingMap.put("1", "是");
		isPassEvaluatingMap.put("0", "否");
	}
	public static LinkedHashMap<String, String> isGetGroundMap = new LinkedHashMap<String, String>();

	public static String START_TIME = "startTime";
	public static String END_TIME = "endTime";
	
	static {
		isGetGroundMap.put("1", "是");
		isGetGroundMap.put("0", "否");
	}
	
	public static List<String> getFilteringChars() {
		
		List<String> chars = new ArrayList<String>();
		chars.add("<");
		chars.add(">");
		chars.add("&lt;");
		chars.add("&gt;");
		chars.add("INSERT");
		chars.add("UPDATE");
		chars.add("DELETE");
		chars.add("DROP");
		chars.add("'");
		chars.add("&#39;");//英文半角单引号  同上一个意思
		
		return chars;
	}

}
